/**
 * 
 */
package com.ruoyi.yanjing.constant;



/**
 * @author kevin
 *
 */
public class CompanyConstant {

	 /**
	 * 根据ID设置成8位的字符串.
	 * 
	 * @param id
	 * @return
	 */
	public static String getId(String id) {
		String buID = "";
		if (id.length() == 1) {
			buID = "00000" + id;
		}
		if (id.length() == 2) {
			buID = "0000" + id;
		}
		if (id.length() == 3) {
			buID = "000" + id;
		}
		if (id.length() == 4) {
			buID = "00" + id;
		}
		if (id.length() == 5) {
			buID = "0" + id;
		}
		return buID;
	}
	
	public static enum COMPANY_TRADE {
		SYSEM("系统"),
		DIANSHANG("电商行业"),
		ZHIZAO("制造行业"),
		WULIU("物流行业");
		private String cnName;
		COMPANY_TRADE(String name){
			this.cnName=name;
		}
		public String getCode(){
			return this.name();
		}
		public String getCnName(){
			return this.cnName;
		}
		public static String getCnName(String code){
			for(COMPANY_TRADE item: COMPANY_TRADE.values()){
				if(item.getCode().equals(code))
				{
					return item.getCnName();
				}
			}
			return code;
		}
		public String toString(){
			return this.name();
		}
	}
	
	public static enum COMPANY_TYPE {
		CUSTOMER("商户"),
		PRODUCE("供应商");
		private String cnName;
		COMPANY_TYPE(String name){
			this.cnName=name;
		}
		public String getCode(){
			return this.name();
		}
		public String getCnName(){
			return this.cnName;
		}
		public static String getCnName(String code){
			for(COMPANY_TYPE item: COMPANY_TYPE.values()){
				if(item.getCode().equals(code))
				{
					return item.getCnName();
				}
			}
			return code;
		}
		public String toString(){
			return this.name();
		}
	}

	public static enum COMPANY_LEVEL {
		SYSTEM("系统企业"),
		USER("用户企业");
		private String cnName;
		COMPANY_LEVEL(String name){
			this.cnName=name;
		}
		public String getCode(){
			return this.name();
		}
		public String getCnName(){
			return this.cnName;
		}
		public static String getCnName(String code){
			for(COMPANY_LEVEL item: COMPANY_LEVEL.values()){
				if(item.getCode().equals(code))
				{
					return item.getCnName();
				}
			}
			return code;
		}
		public String toString(){
			return this.name();
		}
	}
	
	
	public static enum COUPON_TYPE {
		NEWPERSON("新人首单优惠"),
		MANJIAN("满减优惠") ;
		private String cnName;
		COUPON_TYPE(String name){
			this.cnName=name;
		}
		public String getCode(){
			return this.name();
		}
		public String getCnName(){
			return this.cnName;
		}
		public static String getCnName(String code){
			for(COUPON_TYPE item: COUPON_TYPE.values()){
				if(item.getCode().equals(code))
				{
					return item.getCnName();
				}
			}
			return code;
		}
		public String toString(){
			return this.name();
		}
	}
	
	public static enum COST_TYPE {
		MIANFEI("免运费"),
		DAOFU("到付") ;
		private String cnName;
		COST_TYPE(String name){
			this.cnName=name;
		}
		public String getCode(){
			return this.name();
		}
		public String getCnName(){
			return this.cnName;
		}
		public static String getCnName(String code){
			for(COST_TYPE item: COST_TYPE.values()){
				if(item.getCode().equals(code))
				{
					return item.getCnName();
				}
			}
			return code;
		}
		public String toString(){
			return this.name();
		}
	}
}
